<template>
	<view class="content">
		<image class="logo" src="/static/logo.png"></image>
		<view class="text-area">
			<text class="title">{{ title }}</text>
		</view>

		<view class="block">
			秘钥:
			<text>{{ host }}</text>
		</view>
		<view class="block">
			账号:
			<text>{{ nickname }}</text>
		</view>
		<view class="block">
			密码:
			<text>{{ password }}</text>
		</view>
		<view class="block">
			Basic:
			<text>{{ basic }}</text>
		</view>
		<view class="block">
			XXTEA:
			<text>{{ xxtea }}</text>
		</view>
	</view>
</template>

<script>
import '@/components/shoyu-xxtea/shoyu-xxtea';
export default {
	data() {
		return {
			title: 'XXTEA',
			host: 'edusoho.taobao.com',
			nickname: 'shoyu',
			password: '123456',
			basic: false,
			xxtea: false
		};
	},
	onLoad() {
		let that = this;

		let string = that.nickname + ':' + that.password;
		that.basic = Base64.encode(string);

		that.xxtea = XXTEA.encryptToBase64(this.password, that.host);
	},
	methods: {}
};
</script>

<style lang="less">
.content {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.logo {
	height: 200rpx;
	width: 200rpx;
	margin-top: 200rpx;
	margin-left: auto;
	margin-right: auto;
	margin-bottom: 50rpx;
}

.text-area {
	display: flex;
	justify-content: center;
}

.title {
	font-size: 36rpx;
	color: #8f8f94;
}
.block {
	display: block;
	font-size: 28rpx;
	width: calc(100% - 60rpx);
	padding: 0 30rpx;
	line-height: 50rpx;

	text {
		margin-left: 20rpx;
		font-weight: bold;
	}
}
</style>
